package com.lcu.wl.modules.mnt.service;

import com.lcu.wl.common.utils.PageUtils;
import com.lcu.wl.modules.mnt.entity.Log;
import com.baomidou.mybatisplus.extension.service.IService;
import org.aspectj.lang.ProceedingJoinPoint;
import org.springframework.scheduling.annotation.Async;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 系统日志 服务类
 * </p>
 *
 * @author wanglei
 * @since 2021-03-12
 */
public interface ILogService extends IService<Log> {
    /**
     * 日志查询
     * @param params
     * @return
     */
    PageUtils queryPage(Map<String, Object> params,String logType);

    /**
     * 保存日志数据
     * @param username
     * @param browser
     * @param ip
     * @param joinPoint
     * @param log
     */
    @Async
    void save(String username, String browser, String ip, ProceedingJoinPoint joinPoint, Log log);

    /**
     * 查询全部数据
     * @param params
     * @return
     */
    List<Log> queryAll(Map<String, Object> params,String logType);

    /**
     * 导出日志
     * @param logs
     * @param response
     */
    void download(List<Log> logs, HttpServletResponse response) throws IOException;

    /**
     *查询异常详情
     * @param id
     * @return
     */
    Object getByErrDetail(Long id);

}
